﻿using Microsoft.Data.SqlClient;
using System.Configuration;
using System.Data;

string connString = ConfigurationManager.ConnectionStrings["localString"].ConnectionString;
using SqlConnection conn = new(connString);

// 创建适配器
using SqlDataAdapter adapter = new SqlDataAdapter("select * from product",conn);
DataTable dt = new DataTable();
adapter.Fill(dt);

Console.WriteLine(dt.Rows.Count);

string name = ConfigurationManager.AppSettings["siteName"].ToString();
Console.WriteLine(name);
